<%@ page contentType="text/html;charset=UTF-8" %>
<%@ include file="/WEB-INF/views/include/taglib.jsp"%>
<html>
<head>
	<title>warehouse KPI managment</title>
	<meta name="decorator" content="default"/>
	<script type="text/javascript">
		$(document).ready(function() {
			jBoxConfig.languageDefaults  = { 
				    close: 'close', /* 窗口右上角关闭按钮提示 */ 
				    ok: 'ok', /* $.jBox.prompt() 系列方法的“确定”按钮文字 */ 
				    yes: 'yes', /* $.jBox.warning() 方法的“是”按钮文字 */ 
				    no: 'no', /* $.jBox.warning() 方法的“否”按钮文字 */ 
				    cancel: 'cancel' /* $.jBox.confirm() 和 $.jBox.warning() 方法的“取消”按钮文字 */ 
				};
			top.$.jBox.setDefaults(jBoxConfig);
			
			$("#btnExport").click(function(){
				top.$.jBox.confirm("Do you want to download the file？","Reminder",function(v,h,f){
					if(v=="ok"){
						$("#searchForm").attr("action","${ctx}/warehouse/warehouseKpiMonitoring/export");
						$("#searchForm").submit();
					}
				},{buttonsFocus:1});
				top.$('.jbox-body .jbox-icon').css('top','55px');
			});
		});
		function page(n,s){
			$("#pageNo").val(n);
			$("#pageSize").val(s);
			var warehouse = $("#warehouse").val();
			$("#searchForm").attr("action","${ctx}/warehouse/warehouseKpiMonitoring/biwrehouseKpiList?warehouse="+warehouse);
			$("#searchForm").submit();
        	return false;
        }
	</script>
</head>
<body>
   <!-- 
	<ul class="nav nav-tabs">
		<li class="active">仓库KPI监控列表</li>
	</ul>
	 -->
	<form:form id="searchForm" modelAttribute="warehouseKpiMonitoring" action="${ctx}/warehouse/warehouseKpiMonitoring/biwrehouseKpiList" method="post" class="breadcrumb form-search">
		<input id="pageNo" name="pageNo" type="hidden" value="${page.pageNo}"/>
		<input id="pageSize" name="pageSize" type="hidden" value="${page.pageSize}"/>
		<input id="warehouse" name="warehouse" type="hidden" value="${warehouse}"/>
		<!--  
		<sys:tableSort id="orderBy" name="orderBy" value="${page.orderBy}" callback="page();"/>
		-->
		<ul class="ul-form">
			
			<li>
				<label>Date：&nbsp;</label><input id="beginDate" name="beginDate" type="text" readonly="readonly" maxlength="20" class="input-mini Wdate"
					value="<fmt:formatDate value="${biWarehouseKpiData.beginDate}" pattern="yyyy-MM-dd"/>" onclick="WdatePicker({dateFmt:'yyyy-MM-dd',isShowClear:true});"/>
				&nbsp;--&nbsp;<input id="endDate" name="endDate" type="text" readonly="readonly" maxlength="20" class="input-mini Wdate"
					value="<fmt:formatDate value="${biWarehouseKpiData.endDate}" pattern="yyyy-MM-dd"/>" onclick="WdatePicker({dateFmt:'yyyy-MM-dd',isShowClear:true});"/>&nbsp;&nbsp;
			</li>
			
			<li class="btns">
			<input id="btnSubmit" class="btn btn-primary" type="button" value="seach" onclick="return page();"/>
			<input id="btnExport" class="btn btn-primary" type="button" value="download"/>
			</li>
			<li class="clearfix"></li>
		</ul>
		
	</form:form>
	<sys:message content="${message}"/>
	<table id="contentTable" class="table table-striped table-bordered table-condensed">
		<thead>
			<tr>
				<th>Warehouse</th>
				<th>Date</th>
				<!--  
				<th>Month</th>
				<th>Week</th>
				-->
				<th>Attendance</th>
				<th>TTL Valid</th>
				<th>Standard</th>
				<th>Vas</th>
				<th>Unusual</th>
				<th>Supporting</th>
				<th>Valid Output</th>
				<th>Workers</th>
			</tr>
		</thead>
		<tbody>
		<c:forEach items="${page.list}" var="biWarehouseKpiData">
			<tr>
				<td>
					${biWarehouseKpiData.warehouse}
				</td>
				<td>
					<fmt:formatDate value="${biWarehouseKpiData.date}" pattern="yyyy-MM-dd"/>
				</td>
				<!-- 
				<td>
					<fmt:formatDate value="${biWarehouseKpiData.dateMonth}" pattern="yyyy-MM"/>
				</td>
				<td>
					${biWarehouseKpiData.strWeek}
				</td>
				 -->
				<td>
					${biWarehouseKpiData.stunden}
				</td>
				<td>
					${biWarehouseKpiData.effectiveWorkingHours}
				</td>
				<td>
					${biWarehouseKpiData.standardWorkingHours}
				</td>
				<td>
					${biWarehouseKpiData.valueAddedHours}
				</td>
				<td>
					${biWarehouseKpiData.abnormalWorkingHours}
				</td>
				<td>
					${biWarehouseKpiData.supportWorkingHours}
				</td>
				<td>
					<fmt:formatNumber value="${biWarehouseKpiData.effectivePercentage*100}" pattern="0.00" type="number" />
				</td>	
				<td>
					${biWarehouseKpiData.employeeCount}
				</td>
			</tr>
		</c:forEach>
		</tbody>
	</table>
	<div class="pagination">${page}</div>
</body>
</html>